This is the replication archive for the project titled, 
"Disagreements about Threats to Electoral Integrity: Beliefs about the Severity and
Frequency of Fraudulent, Uncounted, and Forgone Votes in the 2020 and 2024 Elections."

The main scripts to replicate the project are in the "scripts" folder. 

*1. Data Wrangling*
01_wrangling.R takes the
raw data and outputs a cleaned dataset called "cleaned_data.Rdata" in the "output" folder.
This includes dataframes for Study 1A and 2A (all labeled df_), Study 1B and 2B (all labeled dfR_), 
and Study 3A and 3B (all labeled df3a_ and df3b).

Note that the raw data is not included in the replication archive because of PII concerns,
but most of the original data remains in its cleaned form in the Rdata file.

*2. Analysis*
Next, 02_analysis.R takes the cleaned data to output all of the tables and figures in the main paper and appendices.
It uses scripts from the "functions" folder to facilitate it. 

For figures: estimate_means.R is a function that outputs a dataframe of estimates. The dataframe then is used as the input in the 
next function, visualize_means.R which is used to create Figures 1, 2, and appendix figures.

For tables: make_texreg.R is a wrapper function for the texreg package, which 
produces nice regression tables.
make_kable.R is a similar wrapper function for the kable package, which
is used to produce nice summary statistics/other miscellaneous tables.